





//
//  U9CommonManager.m
//  U9WatchGame
//
//  Created by uuu9 on 2017/4/25.
//  Copyright © 2017年 Jason. All rights reserved.
//

#import "U9CommonManager.h"
#import "U9TagModel.h"


@implementation U9CommonManager

+ (void)getTagsWithGid:(NSString *)gid andType:(NSString *)type andCompletionHandle:(void (^)(U9TagModel *model,NSError *error))complete{
    PlistStorage *plist = [PlistStorage sharedPlistStorage];
    [self POST:[NSString stringWithFormat:@"%@%@?type=%@&gid=%@",Api_URL,kGetMatchChannel,type,gid]
   parameters:nil
completionHandler:^(id responseObj, NSError *error) {
    U9TagModel *model = [U9TagModel mj_objectWithKeyValues:responseObj];
    if (model.error_code != 0) {
        error = [self createError:model.error_msg];
        model = [U9TagModel mj_objectWithKeyValues:[plist readFromPlist:[NSString stringWithFormat:@"Tagsinfo_%li",(long)type]]];
    } else if (error) {
        model = [U9TagModel mj_objectWithKeyValues:[plist readFromPlist:[NSString stringWithFormat:@"Tagsinfo_%li",(long)type]]];
    } else {
        [plist storageToPlist:responseObj andFileName:[NSString stringWithFormat:@"Tagsinfo_%li",(long)type]];
    }
    complete(model,error);
}];
}





@end
